<!DOCTYPE html>
<html lang="en">

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="viewport"
		content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0,user-scalable=no" />
	<meta name="format-detection" content="telephone=no" />
	<meta name="format-detection" content="email=no" />
	<meta http-equiv="Pragma" content="no-cache" />
	<meta http-equiv="Cache-Control" content="no-cache" />
	<meta http-equiv="Expires" content="0" />
	<title>患者档案-既往病史与过敏史</title>
	<!-- 引入 vant UI 组件库样式文件 -->
	<link rel="stylesheet" href="../../common/css/vant-index.css" />
	<style rel="stylesheet">
		body {
			background-color: #f7f8fa;
		}

		a {
			-webkit-tap-highlight-color: rgba(0, 0, 0, 0);
		}

		a:-webkit-any-link {
			color: #eee;
		}

		.container {
			border: 1px solid #f5f5f5;
			box-shadow: -1px 10px 10px #ececec;
			border-radius: 10px;
			/* margin: 0.6rem; */
			padding: 0;
		}

		.van-tabs__wrap {
			border-radius: 10px;
		}

		#sub-title {
			margin-top: 0.5rem;
			margin-bottom: 0.5rem;
			margin-left: 1rem;
		}

		.icon {
			display: inline-block;
			background-color: #E22E30;
			width: 0.5rem;
			height: 0.5rem;
			margin-right: 0.5rem;
		}

		.text {
			display: inline-block;
			font-size: 1.1rem;
			font-weight: 450;
			color: #555555;
		}

		.van-cell-group--inset {
			margin: 0;
		}

		.van-cell__title {
			flex: 2;
		}

		.van-tabs__line {
			background: #2559a6;
		}

		.tab-btn {
			margin: 0.2rem;
			height: 1.7rem;
			line-height: 1.7rem;
		}
	</style>
</head>

<body>
	<div id="app" v-cloak>
		<div class="container">
			<van-nav-bar title="既往病史与过敏史" left-text="返回" left-arrow @click-left="onClickLeft"
				@click-right="onClickRight">
				<template #right>
					<van-icon name="wap-home-o" size="18" />
				</template>
			</van-nav-bar>
			<van-tabs v-model:active="active">
				<van-tab title="既往病史">
					<div id="sub-title">
						<div class="icon"></div>
						<div class="text">低血糖发生史</div>
					</div>
					<van-cell-group inset>
						<van-cell>
							<template #title>
								<span class="custom-title"> 确诊情况 </span>
							</template>
							<template #value>
								{{currentData.hypoglycemiaIsExist == 1 ?
								'确诊有' : currentData.hypoglycemiaIsExist
								== 2 ? '确诊无' :
								currentData.hypoglycemiaIsExist == 3 ?
								'未确诊' : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 发生频率 </span>
							</template>
							<template #value>
								{{currentData.hypoglycemiaFrequency}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 原因 </span>
							</template>
							<template #value>
								{{currentData.hypoglycemiaCause == 1 ?
								'胰岛素剂量过大' :
								currentData.hypoglycemiaCause == 2 ? '运动'
								: currentData.hypoglycemiaCause == 3 ?
								'不适当的食物摄取' :
								currentData.hypoglycemiaCause == 4 ?
								'口服降血糖药物' :
								currentData.hypoglycemiaCause == 5 ? '乙醇'
								: currentData.hypoglycemiaCause == 6 ?
								'水杨酸盐' : currentData.hypoglycemiaCause
								== 7 ? 'β受体阻滞剂' :
								currentData.hypoglycemiaCause == 8 ?
								'过量应用胰岛素' :
								currentData.hypoglycemiaCause == 9 ?
								'磺脲类药物' : currentData.hypoglycemiaCause
								== 10 ? '2型糖尿病' :
								currentData.hypoglycemiaCause == 11 ?
								currentData.hypoglycemiaCauseOther : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 症状 </span>
							</template>
							<template #value>
								{{currentData.hypoglycemiaIfSymptom == 1 ?
								'无症状' : currentData.hypoglycemiaIfSymptom
								== 2 ? '有症状' : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<div v-show="currentData.hypoglycemiaIfSymptom == 2">
								{{currentData.hypoglycemiaSymptom.indexOf('1')
								!= -1 ? '心慌' : ''}}
								{{currentData.hypoglycemiaSymptom.indexOf('2')
								!= -1 ? '手抖' : ''}}
								{{currentData.hypoglycemiaSymptom.indexOf('3')
								!= -1 ? '出冷汗' : ''}}
								{{currentData.hypoglycemiaSymptom.indexOf('4')
								!= -1 ? '饥饿' : ''}}
								{{currentData.hypoglycemiaSymptom.indexOf('5')
								!= -1 ? '头晕' : ''}}
								{{currentData.hypoglycemiaSymptom.indexOf('6')
								!= -1 ? '眼花' : ''}}
								{{currentData.hypoglycemiaSymptom.indexOf('7')
								!= -1 ? '睡醒时被褥潮湿' : ''}}
								{{currentData.hypoglycemiaSymptom.indexOf('8')
								!= -1 ? '意识障碍' : ''}}
								{{currentData.hypoglycemiaSymptom.indexOf('9')
								!= -1 ? currentData.hypoglycemiaSymptomOther
								: ''}}
							</div>
						</van-cell>
					</van-cell-group>

					<div id="sub-title">
						<div class="icon"></div>
						<div class="text">糖尿病酮症酸中毒发生史</div>
					</div>
					<van-cell-group inset>
						<van-cell>
							<template #title>
								<span class="custom-title"> 确诊情况 </span>
							</template>
							<template #value>
								{{currentData.ketoacidosis == 1 ? '确诊有' :
								currentData.ketoacidosis == 2 ? '确诊无' :
								currentData.ketoacidosis == 3 ? '未确诊' :
								'--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 发生频率 </span>
							</template>
							<template #value>
								{{currentData.ketoacidosisFrequency}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 原因 </span>
							</template>
							<template #value>
								{{currentData.ketoacidosisCause == 1 ?
								'糖尿病酮症酸中毒' :
								currentData.ketoacidosisCause == 2 ?
								'饥饿性酮症' : currentData.ketoacidosisCause
								== 3 ? '酒精性酮症' :
								currentData.ketoacidosisCause == 4 ?
								currentData.ketoacidosisCauseOther : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 程度 </span>
							</template>
							<template #value>
								{{currentData.ketoacidosisDegree == 1 ?
								'轻度：仅有酮症，轻度酸中毒' :
								currentData.ketoacidosisDegree == 2 ?
								'中毒：有酮症及中毒酸中毒' :
								currentData.ketoacidosisDegree == 3 ?
								'重度：有酮症酸中毒伴有昏迷' : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									血酮体检查
								</span>
							</template>
							<template #value>
								{{currentData.ketoacidosisBloodKetone}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									尿酮体检查
								</span>
							</template>
							<template #value>
								{{currentData.ketoacidosisUrineKetone == 1 ?
								'阴性' : currentData.ketoacidosisUrineKetone
								== 2 ? '阳性' : '--'}}
							</template>
						</van-cell>
					</van-cell-group>

					<div id="sub-title">
						<div class="icon"></div>
						<div class="text">糖尿病高渗综合征发生史</div>
					</div>
					<van-cell-group inset>
						<van-cell>
							<template #title>
								<span class="custom-title"> 确诊情况 </span>
							</template>
							<template #value>
								{{currentData.dnhs == 1 ? '确诊有' :
								currentData.dnhs == 2 ? '确诊无' :
								currentData.dnhs == 3 ? '未确诊' : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 发生频率 </span>
							</template>
							<template #value>
								{{currentData.dnhsFrequency}}
							</template>
						</van-cell>
					</van-cell-group>

					<div id="sub-title">
						<div class="icon"></div>
						<div class="text">糖尿病乳酸酸中毒发生史</div>
					</div>
					<van-cell-group inset>
						<van-cell>
							<template #title>
								<span class="custom-title"> 确诊情况 </span>
							</template>
							<template #value>
								{{currentData.lacticAcidosis == 1 ? '确诊有'
								: currentData.lacticAcidosis == 2 ? '确诊无'
								: currentData.lacticAcidosis == 3 ? '未确诊'
								: '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 发生频率 </span>
							</template>
							<template #value>
								{{currentData.lacticAcidosisFrequency}}
							</template>
						</van-cell>
					</van-cell-group>

					<div id="sub-title">
						<div class="icon"></div>
						<div class="text">其他原因导致肾脏疾病</div>
					</div>
					<van-cell-group inset>
						<van-cell>
							<template #title>
								<span class="custom-title"> 确诊情况 </span>
							</template>
							<template #value>
								{{currentData.kidney == 1 ? '确诊有' :
								currentData.kidney == 2 ? '确诊无' :
								currentData.kidney == 3 ? '未确诊' : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 确诊日期 </span>
							</template>
							<template #value>
								{{currentData.kidneyDiseaseDate}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 所患疾病 </span>
							</template>
							<template #value v-if="currentData.kidneyDisease != null">
								{{currentData.kidneyDisease.indexOf('1') !=
								-1 ? '肾脏损伤' : ''}}
								{{currentData.kidneyDisease.indexOf('2') !=
								-1 ? '既往肾脏手术' : ''}}
								{{currentData.kidneyDisease.indexOf('3') !=
								-1 ? '肾衰竭' : ''}}
								{{currentData.kidneyDisease.indexOf('4') !=
								-1 ? currentData.kidneyDiseaseOther : ''}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									尿常规(尿蛋白)
								</span>
							</template>
							<template #value>
								{{currentData.kidneyPro == 1 ? '阴性' :
								currentData.kidneyPro == 2 ? '阳性' : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									尿白蛋白/尿肌酐(ACR)
								</span>
							</template>
							<template #value>
								{{currentData.kidneyAcr}} mg/g
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									血清肌酐(Cr)
								</span>
							</template>
							<template #value>
								{{currentData.kidneyCr}} ummol/L
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									肾小球滤过率(GFR)
								</span>
							</template>
							<template #value>
								{{currentData.kidneyGfr}} %
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									内生肌酐清除率
								</span>
							</template>
							<template #value>
								{{currentData.kidneyCcr}} %
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									其它检查及结果
								</span>
							</template>
							<template #value>
								{{currentData.kidneyDiseaseChecksOther}}
							</template>
						</van-cell>
					</van-cell-group>

					<div id="sub-title">
						<div class="icon"></div>
						<div class="text">其他病史</div>
					</div>
					<van-cell-group inset>
						<van-cell>
							<template #title>
								<span class="custom-title"> 恶性肿瘤 </span>
							</template>
							<template #value>
								{{currentData.malignantTumor == 1 ? '有' :
								currentData.malignantTumor == 2 ? '无' :
								'--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 肝衰竭 </span>
							</template>
							<template #value>
								{{currentData.hepaticFailure == 1 ? '有' :
								currentData.hepaticFailure == 2 ? '无' :
								'--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 癫痫 </span>
							</template>
							<template #value>
								{{currentData.epilepsy == 1 ? '有' :
								currentData.epilepsy == 2 ? '无' : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 青光眼 </span>
							</template>
							<template #value>
								{{currentData.glaucoma == 1 ? '有' :
								currentData.glaucoma == 2 ? '无' : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 白内障 </span>
							</template>
							<template #value>
								{{currentData.cataract == 1 ? '有' :
								currentData.cataract == 2 ? '无' : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									白内障术后
								</span>
							</template>
							<template #value>
								{{currentData.cataractAfterOperation == 1 ?
								'有' : currentData.cataractAfterOperation ==
								2 ? '无' : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									多囊卵巢综合征
								</span>
							</template>
							<template #value>
								{{currentData.pcos == 1 ? '有' :
								currentData.pcos == 2 ? '无' : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									一过性类固醇性糖尿病
								</span>
							</template>
							<template #value>
								{{currentData.steroidDiabetes == 1 ? '有' :
								currentData.steroidDiabetes == 2 ? '无' :
								'--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 败血症 </span>
							</template>
							<template #value>
								{{currentData.septicemia == 1 ? '有' :
								currentData.septicemia == 2 ? '无' : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									血栓栓塞（1年内）
								</span>
							</template>
							<template #value>
								{{currentData.thromboembolism == 1 ? '有' :
								currentData.thromboembolism == 2 ? '无' :
								'--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									血栓形成（1年内）
								</span>
							</template>
							<template #value>
								{{currentData.thrombosis == 1 ? '有' :
								currentData.thrombosis == 2 ? '无' : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 慢性肝病 </span>
							</template>
							<template #value>
								{{currentData.chronicLiver == 1 ? '有' :
								currentData.chronicLiver == 2 ? '无' :
								'--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 脾切除 </span>
							</template>
							<template #value>
								{{currentData.splenectomy == 1 ? '有' :
								currentData.splenectomy == 2 ? '无' : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 老年痴呆 </span>
							</template>
							<template #value>
								{{currentData.senileDementia == 1 ? '有' :
								currentData.senileDementia == 2 ? '无' :
								'--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 精神障碍 </span>
							</template>
							<template #value>
								{{currentData.mentalDisorder == 1 ? '有' :
								currentData.mentalDisorder == 2 ? '无' :
								'--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 智力障碍 </span>
							</template>
							<template #value>
								{{currentData.mentalRetardation == 1 ? '有'
								: currentData.mentalRetardation == 2 ? '无'
								: '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 视力障碍 </span>
							</template>
							<template #value>
								{{currentData.visualImpairment == 1 ? '有' :
								currentData.visualImpairment == 2 ? '无' :
								'--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title"> 截肢 </span>
							</template>
							<template #value>
								{{currentData.amputation == 1 ? '有' :
								currentData.amputation == 2 ? '无' : '--'}}
							</template>
						</van-cell>
					</van-cell-group>
				</van-tab>
				<van-tab title="药物过敏史">
					<div id="sub-title">
						<div class="icon"></div>
						<div class="text">药物过敏史</div>
					</div>
					<van-cell-group inset>
						<van-cell>
							<template #title>
								<span class="custom-title"> 确诊情况 </span>
							</template>
							<template #value>
								{{currentData.allergy == 1 ? '确诊有' :
								currentData.allergy == 2 ? '确诊无' :
								currentData.allergy == 3 ? '未确诊' : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									阿司匹林过敏
								</span>
							</template>
							<template #value>
								{{currentData.allergyAspirin == 1 ? '有' :
								currentData.allergyAspirin == 2 ? '无' :
								'--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									水杨酸盐过敏
								</span>
							</template>
							<template #value>
								{{currentData.allergySalicylic == 1 ? '有' :
								currentData.allergySalicylic == 2 ? '无' :
								'--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									他汀类药物
								</span>
							</template>
							<template #value>
								{{currentData.allergyStatins == 1 ? '有' :
								currentData.allergyStatins == 2 ? '无' :
								'--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									其它过敏药物
								</span>
							</template>
							<template #value>
								{{currentData.allergyOther}}
							</template>
						</van-cell>
					</van-cell-group>
				</van-tab>
				<van-tab title="生育史">
					<div id="sub-title">
						<div class="icon"></div>
						<div class="text">生育史</div>
					</div>
					<van-cell-group inset>
						<van-cell>
							<template #title>
								<span class="custom-title"> 患者性别 </span>
							</template>
							<template #value> </template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									巨大儿生产史
								</span>
							</template>
							<template #value>
								{{currentData.giantBabyProduction == 1 ?
								'有' : currentData.giantBabyProduction == 2
								? '无' : '--'}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									妊娠期显性糖尿病史
								</span>
							</template>
							<template #value>
								{{currentData.dominantGestationalDiabetes ==
								1 ? '有' :
								currentData.dominantGestationalDiabetes == 2
								? '无' : '--'}}
							</template>
						</van-cell>
					</van-cell-group>
				</van-tab>
				<van-tab title="家族史">
					<div id="sub-title">
						<div class="icon"></div>
						<div class="text">家族史</div>
					</div>
					<van-cell-group inset>
						<van-cell>
							<template #title>
								<span class="custom-title">
									早发性心血管疾病家族史
								</span>
							</template>
							<template #value v-if="currentData.familyEarlyOnsetCardiovascular != null">
								{{currentData.familyEarlyOnsetCardiovascular.indexOf('1')
								!= -1 ? '一级男性亲属&gt;55岁' : ''}}
								{{currentData.familyEarlyOnsetCardiovascular.indexOf('2')
								!= -1 ? '一级女性亲属&gt;65岁' : ''}}
								{{currentData.familyEarlyOnsetCardiovascular.indexOf('3')
								!= -1 ? '均没有' : ''}}
							</template>
						</van-cell>
						<van-cell>
							<template #title>
								<span class="custom-title">
									2型糖尿病家族史
								</span>
							</template>
							<template #value>
								{{currentData.familyDiabetes2 == 1 ? '有' :
								currentData.familyDiabetes2 == 2 ? '无' :
								'--'}}
							</template>
						</van-cell>
					</van-cell-group>
				</van-tab>
			</van-tabs>
		</div>
	</div>
</body>
<!-- 上线环境用 -->
<script src="../../common/js/vue.global.prod.js"></script>
<!-- 引入 UI 组件库 -->
<script src="../../common/js/vant.min.js"></script>
<!-- axios 接口调用 -->
<script src="../../common/js/axios.min.js"></script>
<script src="../../base.js"></script>

<script type="module">
	import {
		getAction,
		postAction,
		getUrl,
	} from "../../common/js/api/vue3-axios-utils.js";
	const PatientData = {
		data() {
			return {
				url: {
					getInfo: "/102/18/1021802",
					updateInfo: "/102/18/1021801",
				},
				currentData: {},
				patient_url: "../index.html?userid=",
			};
		},
		created() {
			this.getData().catch((error) => {
				console.log(error);
			});
		},
		methods: {
			async getData() {
				let patientId = localStorage.pid;

				this.patient_url = this.patient_url + patientId;

				let url =
					getUrl() + this.url.getInfo + "?patientId=" + patientId;

				const res = await getAction(url);

				if (res.data.success) {
					this.currentData = await res.data.result;

					// 时间处理
					let dateRegex =
						/\d{4}-(0[1-9]|1[0-2])-(0[1-9]|[12][0-9]|3[01])/g;

					for (let property in this.currentData) {
						if (dateRegex.test(this.currentData[property])) {
							this.currentData[property] =
								this.currentData[property].match(
									dateRegex
								)[0];
						}
					}
				}
			},
			onClickLeft() {
				window.location.href = "../filesIndex.html";
			},
			onClickRight() {
				window.location.href =
					"../index.html?userid=" + localStorage.pid;
			},
		},
	};

	const app = Vue.createApp(PatientData);

	app.use(vant);

	// 通过 CDN 引入时不会自动注册 Lazyload 组件
	// 可以通过下面的方式手动注册
	app.use(vant.Lazyload);

	// 调用函数组件，弹出一个 Toast
	// vant.Toast("刷新成功");

	app.mount("#app");
</script>

</html>
